<div class="wrap">
 	<div id="icon-index" class="icon32"><br /></div><h2><?php echo ucwords(str_replace('_',' ',$this->uri->segment(1)));?> &raquo; <?php echo ucwords(str_replace('_',' ',$this->uri->segment(2)));?></h2>
</div>
<div id="wpbody-content">
    <div class="metabox-holder" id="dashboard-widgets">
            <div class="inside">
				<div class="tablenav top">
					<div class="alignleft"><input type="button" onclick="javascript:parent.location='<?php echo current_url();?>/add'" class="button-primary" value="<?php echo lang('button_add');?>" />&nbsp;<input type="button" value="<?php echo lang('button_update');?>" class="button-primary" onclick="javascript:update_Form(this,'ListForm','<?php echo current_url();?>/update')"/>&nbsp;<input type="button" value="<?php echo lang('button_delete');?>" class="button-primary" onclick="javascript:delete_Form(this,'ListForm','<?php echo current_url();?>/delete')"/></div>
					<p class="search-box">
						<?php echo lang('search_title');?>&nbsp;
						<input type="text" name="txt_search" id="txt_search" <?php echo ($this->input->get('txt_search')!='' ? 'value="'.$this->input->get('txt_search').'"':'');?> onkeydown="javascript:if(event.which==13){ window.location.href='<?php echo current_url();?>/?txt_search='+$('#txt_search').val();}"/>
						<input type="submit" value="<?php echo lang('search_title');?>" class="button" id="search-submit" onclick="javascript:window.location.href='<?php echo current_url();?>/?txt_search='+$('#txt_search').val();"/>
					</p>
				</div>		
				<form action="<?php echo current_url();?>/delete" method="post" name="ListForm" id="ListForm">
				<table cellspacing="0" class="wp-list-table widefat fixed">
					<thead>
					<tr>
						<?php 
							echo generate_th_orderby(array(
								array(
									'name' => '<input type="checkbox"/>',
									'templates' => 'checkbox'
								),	
								array(
									'name' => lang('sort_id'),
									'templates' => 'sort'
								),																
								array(
									'name' => lang('tools'),
									'templates' => 'tools'
								),
								array(
									'name' => lang('main_name'),
									'orderby' => 'main_name',
								),
								array(
									'name' => lang('main_icon'),
									'orderby' => 'main_icon'	
								),
								array(
									'name' => lang('main_page'),
									'orderby' => 'main_page'	
								)
							));
						?>
					</tr>
					</thead>
				
					<tfoot>
					<tr>
						<?php 
							echo generate_th_orderby(array(
								array(
									'name' => '<input type="checkbox"/>',
									'templates' => 'checkbox'
								),	
								array(
									'name' => lang('sort_id'),
									'templates' => 'sort'
								),																
								array(
									'name' => lang('tools'),
									'templates' => 'tools'
								),
								array(
									'name' => lang('main_name'),
									'orderby' => 'main_name',
								),
								array(
									'name' => lang('main_icon'),
									'orderby' => 'main_icon'	
								),
								array(
									'name' => lang('main_page'),
									'orderby' => 'main_page'	
								)
							));
						?>															
					</tr>
					</tfoot>
				
					<tbody>
						<?php
						if(!empty($dataResult)):
							foreach($dataResult as $key => $value):
						?>
							<tr>
								<th class="check-column clean-column" scope="row"><input name="delete_menu[]" value="<?php echo $value->mainmenu_id;?>" type="checkbox" /></th>
								<td class="toolsets" scope="row"><input type="text" name="mainsort_id[<?php echo $value->mainmenu_id;?>]" class="small-text" value="<?php echo $value->mainsort_id;?>" /></td>	
								<td class="toolsets">
									<a href="<?php echo current_url().'/edit/'.$value->mainmenu_id;?>" class="tools edit" title="<?php echo lang('tool_edit');?>"></a>
								</td>
								<td class=""><?php echo $value->main_name;?></td>
								<td class=""><?php echo $value->main_icon;?></td>
								<td class=""><?php echo $value->main_page;?></td>
							</tr>
							<?php
							endforeach;
						else: //not exists
							?>
							<tr valign="middle" class="alternate"><td colspan="6"><?php echo lang('no_data');?></td></tr>			
						<?php
						endif;
						?>
					</tbody>
				</table>
				<div class="tablenav bottom">
					<div class="pager"><?php echo $pager;?></div>
				</div>
				</form>
            </div><!-- wpbody inside -->
    </div><!-- wpcontent -->
</div><!-- wpbody-content -->